<ul class="list big">
<?php if( $model ) : ?>
	<?php foreach ($model as $key => $booking) : ?>
		<?php $object = $booking->object; ?>
		<li class="object <?php echo ($key+1)%3==0 && $key!=0 ? 'third' : '';?>">
			<div class="object-price"><span><?php echo Yii::t("main", "from")?></span> <?php echo CHtml::encode($booking->total_price); ?> €</div>
			<div class="object-img">
				<a href="<?php echo Yii::app()->createUrl('cataloge/view', array('id'=>$object->id)); ?>" title="<?php echo CHtml::encode($object->name); ?>">
					<?php if($object->mainImage){ ?>
						<?php echo $this->material_image($object->mainImage->id, $object->mainImage->name, '205', 'images/'.$object->user_id.'/'.$object->id); ?>
					<?php }else{ ?>
						<?php echo $this->material_image(0, 'noimage.gif', '205', ''); ?>
					<?php } ?>
				</a>
			</div>
			<h3 class="object-name">
				<a href="<?php echo Yii::app()->createUrl('cataloge/view', array('id'=>$object->id)); ?>" title="<?php echo CHtml::encode($object->name); ?>" class=""><?php echo CHtml::encode($object->name); ?></a>
			</h3>
			<?php if(isset($object->roomType)):?>
			<p><?php echo CHtml::encode($object->roomType->name); ?></p>
			<p class="descr"><?php echo CHtml::encode($object->description); ?></p>
			
			<div class="author">
				<a href="<?php echo Yii::app()->createUrl('users/view', array('id'=>$object->user->id));?>" class="photo">
					<?php echo $this->material_image($object->user->id, $object->user->avatar, '38', 'images/' . $object->user->id); ?>
				</a>
				<div class="author_l">
					<p><?php echo $object->user->full_name; ?></p>
					<p><span>10 Review</span></p>
				</div>
				<div class="author_l">
					<p>
						<?php echo Yii::t('main','Check In'); ?> :
						<?php echo Yii::app()->dateFormatter->format("dd/MM/yyyy", $booking->check_in); ?>
					</p>
					<p>
						<?php echo Yii::t('main','Check Out'); ?> :
						<?php echo Yii::app()->dateFormatter->format("dd/MM/yyyy", $booking->check_out); ?>
					</p>
				</div>
				<div>
					<p>
						<?php echo Yii::t('main','Guests'); ?> :
						<?php echo CHtml::encode($booking->guest); ?>
					</p>
				</div>
			</div>
			<?php endif;?>
			<?php $address = $object->country->name.', '.$object->city->name.', '.$object->street.' '.$object->house .'/'.$object->apartment;?>
			<a href="#" class="onmap showMap" title="<?php echo $address?>"><?php echo $address?></a>
		</li>
	<?php endforeach; ?>
<?php else : ?>
	<li class="row cl">
		<div class="message error br3"><?php echo Yii::t("main", "You don't have trips"); ?></div>
	</li>
<?php endif ?>
</ul>